package com.cn.jx.manager.po;

import static com.jx.util.CodeUtil.getRandomId;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.cn.jx.common.entity.BaseEntity;
import com.jx.enumType.YesNoEnum;

/**
 * <p>DictData 数据字典POJO类 对应数据库表名 SYS_DICT
 * <p>实现<{@link Serializable <tt>序列化接口</tt>}
 * <p>实现<{@link BaseEntity <tt>BaseEntity</tt>}
 *  
 * @author <h1>jiangxu2  2019年11月21日</h1>
 * @version v1.11.20.2019
 * @since 1.0
 * 
 */
@Entity
@Table(name="SYS_DICT")
public class DictData extends BaseEntity {

	private static final long serialVersionUID = 7691067708546227838L;

	/** <p>字典名称，字典类型名称 <p>设置为{@link String String}类型*/
	@Column(name="dict_name",length=100,nullable=false)
	private String name;
	
	/** <p>字典值，字典类型值 <p>设置为{@link String String}类型*/
	@Column(name="dict_value",length=64,unique=true,nullable=false)
	private String value;
	
	/** <p>类型，字典类型这个值为空，字典这个值为类型的值 <p>设置为{@link String String}类型*/
	@Column(name="dict_type",length=64,nullable=false)
	private String dictType;
	
	/** <p>级别 字典类型还是字典值<p>设置为{@link String String}类型*/
	@Column(name="dict_level")
	private Integer level;
	
	@Column(name="parent_id")
	private String parent;

	/**
	 * 初始化创建类
	 * @return
	 */
	public static DictData getInstance(String operUser){
		Date day=new Date();
		DictData m=new DictData();
		m.setId(getRandomId());
		m.setDelFlg(YesNoEnum.NO.getCode());
		m.setValidFlg(YesNoEnum.YES.getCode());
		m.setCreateTime(day);
		m.setOperatTime(day);
		m.setOperatUser(operUser);
		m.setCreateUser(operUser);
		return m;
	}
	
	/** <p>{@link String String getParent()*/
	public String getParent() {
		return parent;
	}

	/** <p>setParent({@link String String parent})*/
	public void setParent(String parent) {
		this.parent = parent;
	}


	/** <p>{@link Integer Integer}<p>getLevel()*/
	public Integer getLevel() {
		return level;
	}
	/** <p>{@link String String}<p>getName()*/
	public String getName() {
		return name;
	}
	/** <p>{@link String String}<p>getValue()*/
	public String getValue() {
		return value;
	}
	/** <p>{@link String String}<p>getDictType()*/
	public String getDictType() {
		return dictType;
	}

	/** <p>setLevel({@link Integer level})*/
	public void setLevel(Integer level) {
		this.level = level;
	}

	/** <p>setName({@link String name})*/
	public void setName(String name) {
		this.name = name;
	}

	/** <p>setValue({@link String value})*/
	public void setValue(String value) {
		this.value = value;
	}

	/** <p>setDictType({@link String dictType})*/
	public void setDictType(String dictType) {
		this.dictType = dictType;
	}
}
